<?php
    define('KYOMINI_GO',true);	
    require_once('admin_conn.php');
	require_once ('../Config/conn.php"');
    session_start();
	

	
	 $id=$_POST['id'];
	
	  if($HOST != $_SESSION['host']){

          echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p>禁止跨站非法提交！';
	      exit;

	  } else{
	
	  if($_POST['title'] == "" || $_POST['content'] == ""){
		  
		  echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p>您还没有填写数据！';
	      echo '<script>setTimeout(\'location="Article_edit.php?id='.$id.'"\', 3000);</script>';
		  
		  }else{

		 
    	$xx=$db->update("article", array(
		 "title" => $_POST['title'],
		 "content" => $_POST['content'],
		 ),array(
		 "id" => $id
		 )
		);
		
		echo '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>修改成功！';
	    echo '<script>setTimeout(\'location="Article_edit.php?id='.$id.'"\', 3000);</script>';
	  }
	  }
	

	
?>